Option Explicit

'################################################################
' Public
'################################################################
Public Function objectStringify( _
    o As Variant, _
    Optional pretty As Boolean = True, _
    Optional explodeArrays As Boolean = True, _
    Optional explodeCollections As Boolean = False) As String

    Dim jResult As cJobject
    ' make this into an jsonifiable object
    Set jResult = jObjectify(o, explodeArrays, explodeCollections)
    ' json.stringify it
    If (Not jResult Is Nothing) Then
        objectStringify = jResult.stringify(pretty)
        jResult.tearDown
    Else
        objectStringify = "{" & quote("error") & ":" & quote("could not stringify class") & "}"
    End If
End Function